<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Module: Haml</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Module</strong></td>
          <td class="class-name-in-header">Haml</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../files/vendor/plugins/haml/lib/haml/buffer_rb.html">
                vendor/plugins/haml/lib/haml/buffer.rb
                </a>
        <br />
                <a href="../files/vendor/plugins/haml/lib/haml/engine_rb.html">
                vendor/plugins/haml/lib/haml/engine.rb
                </a>
        <br />
                <a href="../files/vendor/plugins/haml/lib/haml/error_rb.html">
                vendor/plugins/haml/lib/haml/error.rb
                </a>
        <br />
                <a href="../files/vendor/plugins/haml/lib/haml/exec_rb.html">
                vendor/plugins/haml/lib/haml/exec.rb
                </a>
        <br />
                <a href="../files/vendor/plugins/haml/lib/haml/helpers/action_view_extensions_rb.html">
                vendor/plugins/haml/lib/haml/helpers/action_view_extensions.rb
                </a>
        <br />
                <a href="../files/vendor/plugins/haml/lib/haml/helpers_rb.html">
                vendor/plugins/haml/lib/haml/helpers.rb
                </a>
        <br />
                <a href="../files/vendor/plugins/haml/lib/haml/html_rb.html">
                vendor/plugins/haml/lib/haml/html.rb
                </a>
        <br />
                <a href="../files/vendor/plugins/haml/lib/haml/template_rb.html">
                vendor/plugins/haml/lib/haml/template.rb
                </a>
        <br />
                <a href="../files/vendor/plugins/haml/lib/haml_rb.html">
                vendor/plugins/haml/lib/haml.rb
                </a>
        <br />
            </td>
        </tr>

        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">

    <div id="description">
      <h1><a href="Haml.html">Haml</a> (XHTML Abstraction Markup Language)</h1>
<p>
<a href="Haml.html">Haml</a> is a markup language that&#8216;s used to
cleanly and simply describe the XHTML of any web document, without the use
of inline code. <a href="Haml.html">Haml</a> functions as a replacement for
inline page templating systems such as PHP, ERB, and ASP. However, <a
href="Haml.html">Haml</a> avoids the need for explicitly coding XHTML into
the template, because it is actually an abstract description of the XHTML,
with some code to generate dynamic content.
</p>
<h2>Features</h2>
<ul>
<li>Whitespace active

</li>
<li>Well-formatted markup

</li>
<li>DRY

</li>
<li>Follows CSS conventions

</li>
<li>Integrates Ruby code

</li>
<li>Implements Rails templates with the .haml extension

</li>
</ul>
<h2>Using <a href="Haml.html">Haml</a></h2>
<p>
<a href="Haml.html">Haml</a> can be used in two ways: as a plugin for Ruby
on Rails, and as a standalong Ruby module.
</p>
<h3>Rails</h3>
<p>
<a href="Haml.html">Haml</a> is most commonly used as a plugin. It can be
installed as a plugin using the Rails plugin installer:
</p>
<pre>
  ./script/plugin install http://svn.hamptoncatlin.com/haml/tags/stable
</pre>
<p>
Once it&#8216;s installed, all view files with the &quot;.haml&quot;
extension will be compiled using <a href="Haml.html">Haml</a>.
</p>
<p>
You can access instance variables in <a href="Haml.html">Haml</a> templates
the same way you do in ERb templates. Helper methods are also available in
<a href="Haml.html">Haml</a> templates. For example:
</p>
<pre>
  # file: app/controllers/movies_controller.rb

  class MoviesController &lt; ApplicationController
    def index
      @title = &quot;Teen Wolf&quot;
    end
  end

  # file: app/views/movies/index.haml

  #content
   .title
     %h1= @title
     = link_to 'Home', home_url
</pre>
<p>
may be compiled to:
</p>
<pre>
  &lt;div id='content'&gt;
    &lt;div class='title'&gt;
      &lt;h1&gt;Teen Wolf&lt;/h1&gt;
      &lt;a href='/'&gt;Home&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
</pre>
<h3>Ruby Module</h3>
<p>
<a href="Haml.html">Haml</a> can also be used completely separately from
Rails and <a href="ActionView.html">ActionView</a>. To do this, install the
gem with RubyGems:
</p>
<pre>
  gem install haml
</pre>
<p>
You can then use it by including the &quot;haml&quot; gem in Ruby code, and
using <a href="Haml/Engine.html">Haml::Engine</a> like so:
</p>
<pre>
  engine = Haml::Engine.new(&quot;%p Haml code!&quot;)
  engine.render #=&gt; &quot;&lt;p&gt;Haml code!&lt;/p&gt;\n&quot;
</pre>
<h2>Characters with meaning to <a href="Haml.html">Haml</a></h2>
<p>
Various characters, when placed at a certain point in a line, instruct <a
href="Haml.html">Haml</a> to render different types of things.
</p>
<h3>XHTML Tags</h3>
<p>
These characters render XHTML tags.
</p>
<h4>%</h4>
<p>
The percent character is placed at the beginning of a line. It&#8216;s
followed immediately by the name of an element, then optionally by
modifiers (see below), a space, and text to be rendered inside the element.
It creates an element in the form of
<tt>&lt;element&gt;&lt;/element&gt;</tt>. For example:
</p>
<pre>
  %one
    %two
      %three Hey there
</pre>
<p>
is compiled to:
</p>
<pre>
  &lt;one&gt;
    &lt;two&gt;
      &lt;three&gt;Hey there&lt;/three&gt;
    &lt;/two&gt;
  &lt;/one&gt;
</pre>
<p>
Any string is a valid element name; <a href="Haml.html">Haml</a> will
automatically generate opening and closing tags for any element.
</p>
<h4>{}</h4>
<p>
Brackets represent a Ruby hash that is used for specifying the attributes
of an element. It is literally evaluated as a Ruby hash, so logic will work
in it and local variables may be used. Quote characters within the
attribute will be replaced by appropriate escape sequences. The hash is
placed after the tag is defined. For example:
</p>
<pre>
  %head{ :name =&gt; &quot;doc_head&quot; }
    %script{ 'type' =&gt; &quot;text/&quot; + &quot;javascript&quot;,
             :src   =&gt; &quot;javascripts/script_#{2 + 7}&quot; }
</pre>
<p>
is compiled to:
</p>
<pre>
  &lt;head name=&quot;doc_head&quot;&gt;
    &lt;script src='javascripts/script_9' type='text/javascript'&gt;
    &lt;/script&gt;
  &lt;/head&gt;
</pre>
<h4>[]</h4>
<p>
Square brackets follow a tag definition and contain a Ruby object that is
used to set the class and id of that tag. The class is set to the
object&#8216;s class (transformed to use underlines rather than camel case)
and the id is set to the object&#8216;s class, followed by its id. Because
the id of an object is normally an obscure implementation detail, this is
most useful for elements that represent instances of Models. For example:
</p>
<pre>
  # file: app/controllers/users_controller.rb

  def show
    @user = CrazyUser.find(15)
  end

  # file: app/views/users/show.haml

  %div[@user]
    %bar[290]/
    Hello!
</pre>
<p>
is compiled to:
</p>
<pre>
  &lt;div class=&quot;crazy_user&quot; id=&quot;crazy_user_15&quot;&gt;
    &lt;bar class=&quot;fixnum&quot; id=&quot;fixnum_581&quot; /&gt;
    Hello!
  &lt;/div&gt;
</pre>
<p>
This is based off of DHH&#8216;s SimplyHelpful syntax, as presented at
RailsConf Europe 2006.
</p>
<h4>/</h4>
<p>
The forward slash character, when placed at the end of a tag definition,
causes the tag to be self-closed. For example:
</p>
<pre>
  %br/
  %meta{'http-equiv' =&gt; 'Content-Type', :content =&gt; 'text/html'}/
</pre>
<p>
is compiled to:
</p>
<pre>
  &lt;br /&gt;
  &lt;meta http-equiv='Content-Type' content='text/html' /&gt;
</pre>
<p>
Some tags are automatically closed, as long as they have no content.
<tt>meta</tt>, <tt>img</tt>, <tt>link</tt>, <tt>script</tt>, <tt>br</tt>,
and <tt>hr</tt> tags are closed by default. This list can be customized by
setting the <tt>:autoclose</tt> option (see below). For example:
</p>
<pre>
  %br
  %meta{'http-equiv' =&gt; 'Content-Type', :content =&gt; 'text/html'}
</pre>
<p>
is also compiled to:
</p>
<pre>
  &lt;br /&gt;
  &lt;meta http-equiv='Content-Type' content='text/html' /&gt;
</pre>
<h4>. and #</h4>
<p>
The period and pound sign are borrowed from CSS. They are used as shortcuts
to specify the <tt>class</tt> and <tt>id</tt> attributes of an element,
respectively. Multiple class names can be specified in a similar way to
CSS, by chaining the class names together with periods. They are placed
immediately after the tag and before an attributes hash. For example:
</p>
<pre>
  %div#things
    %span#rice Chicken Fried
    %p.beans{ :food =&gt; 'true' } The magical fruit
    %h1.class.otherclass#id La La La
</pre>
<p>
is compiled to:
</p>
<pre>
  &lt;div id='things'&gt;
    &lt;span id='rice'&gt;Chicken Fried&lt;/span&gt;
    &lt;p class='beans' food='true'&gt;The magical fruit&lt;/p&gt;
    &lt;h1 class='class otherclass' id='id'&gt;La La La&lt;/h1&gt;
  &lt;/div&gt;
</pre>
<p>
And,
</p>
<pre>
  #content
    .articles
      .article.title
        Doogie Howser Comes Out
      .article.date
        2006-11-05
      .article.entry
        Neil Patrick Harris would like to dispel any rumors that he is straight
</pre>
<p>
is compiled to:
</p>
<pre>
  &lt;div id=&quot;content&quot;&gt;
    &lt;div class=&quot;articles&quot;&gt;
      &lt;div class=&quot;article title&quot;&gt;Doogie Howser Comes Out&lt;/div&gt;
      &lt;div class=&quot;article date&quot;&gt;2006-11-05&lt;/div&gt;
      &lt;div class=&quot;article entry&quot;&gt;
        Neil Patrick Harris would like to dispel any rumors that he is straight
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
</pre>
<h4>Implicit Div Elements</h4>
<p>
Because the div element is used so often, it is the default element. If you
only define a class and/or id using the <tt>.</tt> or <tt>#</tt> syntax, a
div element is automatically used. For example:
</p>
<pre>
  #collection
    .item
      .description What a cool item!
</pre>
<p>
is the same as:
</p>
<pre>
  %div{:id =&gt; collection}
    %div{:class =&gt; 'item'}
      %div{:class =&gt; 'description'} What a cool item!
</pre>
<p>
and is compiled to:
</p>
<pre>
  &lt;div id='collection'&gt;
    &lt;div class='item'&gt;
      &lt;div class='description'&gt;What a cool item!&lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
</pre>
<h4>=</h4>
<p>
<tt>=</tt> is placed at the end of a tag definition, after class, id, and
attribute declarations. It&#8216;s just a shortcut for inserting Ruby code
into an element. It works the same as <tt>=</tt> without a tag: it inserts
the result of the Ruby code into the template. However, if the result is
short enough, it is displayed entirely on one line. For example:
</p>
<pre>
  %p= &quot;hello&quot;
</pre>
<p>
is not quite the same as:
</p>
<pre>
  %p
    = &quot;hello&quot;
</pre>
<p>
It&#8216;s compiled to:
</p>
<pre>
  &lt;p&gt;hello&lt;/p&gt;
</pre>
<h3>XHTML <a href="Haml/Helpers.html">Helpers</a></h3>
<h4>No Special Character</h4>
<p>
If no special character appears at the beginning of a line, the line is
rendered as plain text. For example:
</p>
<pre>
  %gee
    %whiz
      Wow this is cool!
</pre>
<p>
is compiled to:
</p>
<pre>
  &lt;gee&gt;
    &lt;whiz&gt;
      Wow this is cool!
    &lt;/whiz&gt;
  &lt;/gee&gt;
</pre>
<h4>!!!</h4>
<p>
When describing XHTML documents with <a href="Haml.html">Haml</a>, you can
have a document type or XML prolog generated automatically by including the
characters <tt>!!!</tt>. For example:
</p>
<pre>
  !!! XML
  !!!
  %html
    %head
      %title Myspace
    %body
      %h1 I am the international space station
      %p Sign my guestbook
</pre>
<p>
is compiled to:
</p>
<pre>
  &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;
  &lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;title&gt;Myspace&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;h1&gt;I am the international space station&lt;/h1&gt;
      &lt;p&gt;Sign my guestbook&lt;/p&gt;
    &lt;/body&gt;
  &lt;/html&gt;
</pre>
<p>
You can also specify the version and type of XHTML after the <tt>!!!</tt>.
XHTML 1.0 Strict, Transitional, and Frameset and XHTML 1.1 are supported.
The default version is 1.0 and the default type is Transitional. For
example:
</p>
<pre>
  !!! 1.1
</pre>
<p>
is compiled to:
</p>
<pre>
  &lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.1//EN&quot; &quot;http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd&quot;&gt;
</pre>
<p>
and
</p>
<pre>
  !!! Strict
</pre>
<p>
is compiled to:
</p>
<pre>
  &lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;
</pre>
<p>
If you&#8216;re not using the UTF-8 characterset for your document, you can
specify which encoding should appear in the XML prolog in a similar way.
For example:
</p>
<pre>
  !!! XML iso-8859-1
</pre>
<p>
is compiled to:
</p>
<pre>
  &lt;?xml version=&quot;1.0&quot; encoding=&quot;iso-8859-1&quot; ?&gt;
</pre>
<h4>/</h4>
<p>
The forward slash character, when placed at the beginning of a line, wraps
all text after it in an <a href="Haml/HTML.html">HTML</a> comment. For
example:
</p>
<pre>
  %billabong
    / This is the billabong element
    I like billabongs!
</pre>
<p>
is compiled to:
</p>
<pre>
  &lt;billabong&gt;
    &lt;!-- This is the billabong element --&gt;
    I like billabongs!
  &lt;/billabong&gt;
</pre>
<p>
The forward slash can also wrap indented sections of code. For example:
</p>
<pre>
  /
    %p This doesn't render...
    %div
      %h1 Because it's commented out!
</pre>
<p>
is compiled to:
</p>
<pre>
  &lt;!--
    &lt;p&gt;This doesn't render...&lt;/p&gt;
    &lt;div&gt;
      &lt;h1&gt;Because it's commented out!&lt;/h1&gt;
    &lt;/div&gt;
  --&gt;
</pre>
<p>
You can also use Internet Explorer conditional comments (<a
href="http://www.quirksmode.org/css/condcom.html">about)</a> by enclosing
the condition in square brackets after the <tt>/</tt>. For example:
</p>
<pre>
  /[if IE]
    %a{ :href =&gt; 'http://www.mozilla.com/en-US/firefox/' }
      %h1 Get Firefox
</pre>
<p>
is compiled to:
</p>
<pre>
  &lt;!--[if IE]&gt;
    &lt;a href='http://www.mozilla.com/en-US/firefox/'&gt;
      &lt;h1&gt;Get Firefox&lt;/h1&gt;
    &lt;/a&gt;
  &lt;![endif]--&gt;
</pre>
<h4>#</h4>
<p>
The backslash character escapes the first character of a line, allowing use
of otherwise interpreted characters as plain text. For example:
</p>
<pre>
  %title
    = @title
    \- MySite
</pre>
<p>
is compiled to:
</p>
<pre>
  &lt;title&gt;
    MyPage
    - MySite
  &lt;/title&gt;
</pre>
<h4>|</h4>
<p>
The pipe character designates a multiline string. It&#8216;s placed at the
end of a line and means that all following lines that end with <tt>|</tt>
will be evaluated as though they were on the same line. For example:
</p>
<pre>
  %whoo
    %hoo I think this might get |
      pretty long so I should |
      probably make it |
      multiline so it doesn't |
      look awful. |
    %p This is short.
</pre>
<p>
is compiled to:
</p>
<pre>
  &lt;whoo&gt;
    &lt;hoo&gt;
      I think this might get pretty long so I should probably make it multiline so it doesn't look awful.
    &lt;/hoo&gt;
  &lt;/whoo&gt;
</pre>
<h4>:</h4>
<p>
The colon character designates a filter. This allows you to pass an
indented block of text as input to another filtering program and add the
result to the output of <a href="Haml.html">Haml</a>. The syntax is simply
a colon followed by the name of the filter. For example,
</p>
<pre>
  %p
    :markdown
      Textile
      =======

      Hello, *World*
</pre>
<p>
is compiled to
</p>
<pre>
  &lt;p&gt;
    &lt;h1&gt;Textile&lt;/h1&gt;

    &lt;p&gt;Hello, &lt;em&gt;World&lt;/em&gt;&lt;/p&gt;
  &lt;/p&gt;
</pre>
<p>
<a href="Haml.html">Haml</a> has the following filters defined:
</p>
<dl>
<dt>plain</dt><dd>Does not parse the filtered text. This is useful for large blocks of text
without <a href="Haml/HTML.html">HTML</a> tags, when you don&#8216;t want
lines starting with <tt>.</tt> or <tt>-</tt> to be parsed.

</dd>
<dt>ruby</dt><dd>Parses the filtered text with the normal Ruby interpreter. All output sent
to <tt>$stdout</tt>, like with <tt>puts</tt>, is output into the <a
href="Haml.html">Haml</a> document. Not available if the
<tt>suppress_eval</tt> option is set to true.

</dd>
<dt>preserve</dt><dd>Inserts the filtered text into the template with whitespace preserved.
<tt>preserve</tt>d blocks of text aren&#8216;t indented, and newlines are
replaced with the <a href="Haml/HTML.html">HTML</a> escape code for
newlines, to preserve nice-looking output.

</dd>
<dt>erb</dt><dd>Parses the filtered text with ERB, like an RHTML template. Not available if
the <tt>suppress_eval</tt> option is set to true. At the moment, this
doesn&#8216;t support access to variables defined by Ruby on Rails or <a
href="Haml.html">Haml</a> code.

</dd>
<dt>sass</dt><dd>Parses the filtered text with <a href="Sass.html">Sass</a> to produce CSS
output.

</dd>
<dt>redcloth</dt><dd>Parses the filtered text with RedCloth (<a
href="http://whytheluckystiff.net/ruby/redcloth">whytheluckystiff.net/ruby/redcloth</a>),
which uses both Textile and Markdown syntax. Only works if RedCloth is
installed.

</dd>
<dt>textile</dt><dd>Parses the filtered text with Textile (<a
href="http://www.textism.com/tools/textile">www.textism.com/tools/textile</a>).
Only works if RedCloth is installed.

</dd>
<dt>markdown</dt><dd>Parses the filtered text with Markdown (<a
href="http://daringfireball.net/projects/markdown">daringfireball.net/projects/markdown</a>).
Only works if RedCloth or BlueCloth (<a
href="http://www.deveiate.org/projects/BlueCloth">www.deveiate.org/projects/BlueCloth</a>)
is installed (BlueCloth takes precedence if both are installed).

</dd>
</dl>
<p>
You can also define your own filters (see Setting Options, below).
</p>
<h3>Ruby evaluators</h3>
<h4>=</h4>
<p>
The equals character is followed by Ruby code, which is evaluated and the
output inserted into the document as plain text. For example:
</p>
<pre>
  %p
    = ['hi', 'there', 'reader!'].join &quot; &quot;
    = &quot;yo&quot;
</pre>
<p>
is compiled to:
</p>
<pre>
  &lt;p&gt;
    hi there reader!
    yo
  &lt;/p&gt;
</pre>
<p>
You can also use two equal signs, <tt>==</tt>, along with conventional Ruby
string-embedding syntax to easily embed Ruby code in otherwise static text.
For example:
</p>
<pre>
  %p
    == 1 + 1 = #{1 + 1}
</pre>
<p>
is compiled to:
</p>
<pre>
  &lt;p&gt;
    1 + 1 = 2
  &lt;/p&gt;
</pre>
<h4>-</h4>
<p>
The hyphen character makes the text following it into &quot;silent
script&quot;: Ruby script that is evaluated, but not output.
</p>
<p>
<b>It is not recommended that you use this widely; almost all processing
code and logic should be restricted to the Controller, the Helper, or
partials.</b>
</p>
<p>
For example:
</p>
<pre>
  - foo = &quot;hello&quot;
  - foo &lt;&lt; &quot; there&quot;
  - foo &lt;&lt; &quot; you!&quot;
  %p= foo
</pre>
<p>
is compiled to:
</p>
<pre>
  &lt;p&gt;
    hello there you!
  &lt;/p&gt;
</pre>
<h5>Blocks</h5>
<p>
Ruby blocks, like XHTML tags, don&#8216;t need to be explicitly closed in
<a href="Haml.html">Haml</a>. Rather, they&#8216;re automatically closed,
based on indentation. A block begins whenever the indentation is increased
after a silent script command. It ends when the indentation decreases (as
long as it&#8216;s not an <tt>else</tt> clause or something similar). For
example:
</p>
<pre>
  - (42...47).each do |i|
    %p= i
  %p See, I can count!
</pre>
<p>
is compiled to:
</p>
<pre>
  &lt;p&gt;
    42
  &lt;/p&gt;
  &lt;p&gt;
    43
  &lt;/p&gt;
  &lt;p&gt;
    44
  &lt;/p&gt;
  &lt;p&gt;
    45
  &lt;/p&gt;
  &lt;p&gt;
    46
  &lt;/p&gt;
</pre>
<p>
Another example:
</p>
<pre>
  %p
    - case 2
    - when 1
      = &quot;1!&quot;
    - when 2
      = &quot;2?&quot;
    - when 3
      = &quot;3.&quot;
</pre>
<p>
is compiled to:
</p>
<pre>
  &lt;p&gt;
    2?
  &lt;/p&gt;
</pre>
<h4>-#</h4>
<p>
The hyphen followed immediately by the pound sign signifies a silent
comment. Any text following this isn&#8216;t rendered in the resulting
document at all.
</p>
<p>
For example:
</p>
<p>
%p foo -# This is a comment %p bar
</p>
<p>
is compiled to:
</p>
<p>
&lt;p&gt;foo&lt;/p&gt; &lt;p&gt;bar&lt;/p&gt;
</p>
<h2>Other Useful Things</h2>
<h3><a href="Haml/Helpers.html">Helpers</a></h3>
<p>
<a href="Haml.html">Haml</a> offers a bunch of helpers that are useful for
doing stuff like preserving whitespace, creating nicely indented output for
user-defined helpers, and other useful things. The helpers are all
documented in the <a href="Haml/Helpers.html">Haml::Helpers</a> and <a
href="Haml/Helpers/ActionViewExtensions.html">Haml::Helpers::ActionViewExtensions</a>
modules.
</p>
<h3><a href="Haml.html">Haml</a> Options</h3>
<p>
Options can be set by setting the hash <tt><a
href="Haml/Template.html#M000038">Haml::Template.options</a></tt> from
<tt>environment.rb</tt> in Rails, or by passing an options hash to <a
href="Haml/Engine.html">Haml::Engine</a>. Available options are:
</p>
<dl>
<dt><tt>:suppress_eval</tt></dt><dd>Whether or not attribute hashes and Ruby scripts designated by <tt>=</tt>
or <tt>~</tt> should be evaluated. If this is true, said scripts are
rendered as empty strings. Defaults to false.

</dd>
<dt><tt>:attr_wrapper</tt></dt><dd>The character that should wrap element attributes. This defaults to
<tt>&#8216;</tt> (an apostrophe). Characters of this type within the
attributes will be escaped (e.g. by replacing them with
<tt>&amp;apos;</tt>) if the character is an apostrophe or a quotation mark.

</dd>
<dt><tt>:filename</tt></dt><dd>The name of the <a href="Haml.html">Haml</a> file being parsed. This is
only used as information when exceptions are raised. This is automatically
assigned when working through <a href="ActionView.html">ActionView</a>, so
it&#8216;s really only useful for the user to assign when dealing with <a
href="Haml.html">Haml</a> programatically.

</dd>
<dt><tt>:filters</tt></dt><dd>A hash of filters that can be applied to <a href="Haml.html">Haml</a> code.
The keys are the string names of the filters; the values are references to
the classes of the filters. User-defined filters should always have
lowercase keys, and should have:

<ul>
<li>An <tt>initialize</tt> method that accepts one parameter, the text to be
filtered.

</li>
<li>A <tt>render</tt> method that returns the result of the filtering.

</li>
</ul>
</dd>
<dt><tt>:locals</tt></dt><dd>The local variables that will be available within the template. For
instance, if <tt>:locals</tt> is <tt>{ :foo =&gt; &quot;bar&quot; }</tt>,
then within the template, <tt>= foo</tt> will produce <tt>bar</tt>.

</dd>
<dt><tt>:autoclose</tt></dt><dd>A list of tag names that should be automatically self-closed if they have
no content. Defaults to <tt>[&#8216;meta&#8217;, &#8216;img&#8217;,
&#8216;link&#8217;, &#8216;script&#8217;, &#8216;br&#8217;,
&#8216;hr&#8217;]</tt>.

</dd>
</dl>

    </div>


   </div>


  </div>


    <!-- if includes -->

    <div id="section">

    <div id="class-list">
      <h3 class="section-bar">Classes and Modules</h3>

      Module <a href="Haml/Error.html" class="link">Haml::Error</a><br />
Module <a href="Haml/Helpers.html" class="link">Haml::Helpers</a><br />
Class <a href="Haml/Buffer.html" class="link">Haml::Buffer</a><br />
Class <a href="Haml/Engine.html" class="link">Haml::Engine</a><br />
Class <a href="Haml/HTML.html" class="link">Haml::HTML</a><br />
Class <a href="Haml/HamlError.html" class="link">Haml::HamlError</a><br />
Class <a href="Haml/SyntaxError.html" class="link">Haml::SyntaxError</a><br />
Class <a href="Haml/Template.html" class="link">Haml::Template</a><br />

    </div>




      


    <!-- if method_list -->


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>